 function afficherfooter(){
     document.write("<div id='footer'> <address> All right reserved ||<a href='mailto:ghada@hotmail.fr'>Contacter Admin</a></address> </div>");
 }

function verification_session() {
        
   
         
         if (readCookie("Syba_connexion") !== null) {
          
            document.getElementById('aff_pseudo2').innerHTML = readCookie("Syba_connexion");
            
         }
         else {
              
              //document.getElementById('connecté').setAttribute('style', 'display:none;');
              window.location ="../../index.html";
         }
    }
    function verification_session2(){
         if (readCookie("Syba_connexion") === null) {
             window.location ="../../index.html";
         }
    }

function trim (myString)
{
	return myString.replace(/^\s+/g,'').replace(/\s+$/g,'');
}
function stringToXML(txt) {
	var xmlDoc ;
	if (window.DOMParser)
	{
		parser=new DOMParser();
		xmlDoc=parser.parseFromString(txt,"text/xml");
	}
	else // Internet Explorer
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.loadXML(txt);
	}
	return xmlDoc ;
}

function readData(sData) {
	// On peut maintenant traiter les donn�es sans encombrer l'objet XHR.
	if (sData == "OK") {
		alert("C'est bon");
	} else {
		alert("Y'a eu un probl�me : "+sData);
	}
}

/*
 * FONCTIONS POUR LA PARTIE COOOOOOOOKIES !
 */
/**
 * This function allows the creation of a cookie.
 * @param name the name of the cookie
 * @param value the value of the cookie
 * @param days the number of days before the cookie disappears
 */
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

      function ReadCookie()
{
    var tab = new Array ();
    var allcookies = document.cookie;
   //alert("All Cookies : " + allcookies );

   // Get all the cookies pairs in an array
    cookiearray  = allcookies.split(';');

   // Now take key value pair out of this array
    for(var i=0; i<cookiearray.length; i++){
      name = cookiearray[i].split('=')[0];
      value = cookiearray[i].split('=')[1];
      tab.push(value);
      //alert("Key is : " + name + " and Value is : " + value);
   }
   return tab;
}

function addslashes (str) {
  
  return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0');
}
